using System;
using System.Collections.Generic;
using System.Text;
using DAO;
using DTO;
using System.Data.SqlClient;
using System.Data;
namespace BUS
{
    public class DatHangBUS
    {
        public static DataTable LayThongTinSua()
        {
            DataTable dt = DatHangDAO.LayThongTinSua();
            return dt;
        }
        public static DataTable InThongTinHoaDon(string MaKh)
        {
            DataTable dt = DatHangDAO.InThongTinHoaDon(MaKh);
            return dt;
        }

        public static bool KiemTraKhachHang(string MaKH)
        {
            if (DatHangDAO.KiemTraKhachHang(MaKH) == true)
            {
                return true;
            }
            return false;
        }

        #region  Inserting HoaDOn
        public static bool InsertHoaDon(DatHangDTO dh)
        {
            if (DatHangDAO.KiemTraKhachHang(dh.MaKH) == true)
            {
                return DatHangDAO.NhapDatHang(dh);
            }
            return false;

        }
        #endregion

        #region  Inserting HoaDOn
        public static void InsertChiTietHoaDon(DatHangDTO dh)
        {
            DatHangDAO.NhapChiTietHoaDon(dh);
        }
        #endregion
    }
}
